package sourceCodeAnalysis.CGLIB;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class AttendanceMethodInterceptor implements MethodInterceptor {
//    @Override
//    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
//        System.out.println("上班打卡……");
//
//        Object result = proxy.invokeSuper(obj, args);
//
//        System.out.println("下班打卡……");
//
//        return result;
//    }
@Override
public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
    Object result = proxy.invokeSuper(obj, args);
    args[0]=result;
    result = proxy.invokeSuper(obj,args);
    return result;
}

}
